package com.yingside.system.controller;


import com.yingside.common.util.ResultVO;
import com.yingside.system.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yingside
 * @since 2020-12-30
 */
@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private IMenuService menuService;

    @GetMapping("/index")
    public String index(){
        return "menu/menu-list";
    }

    @GetMapping("/tree")
    @ResponseBody
    public ResultVO tree(){
        return ResultVO.success(menuService.selectAllTree());
    }
}
